3.1.97 \(\int (c+d x)^2 (a+i a \sinh (e+f x)) \, dx\) [97]

Optimal. Leaf size=74 \[ \frac {a (c+d x)^3}{3 d}+\frac {2 i a d^2 \cosh (e+f x)}{f^3}+\frac {i a (c+d x)^2 \cosh (e+f x)}{f}-\frac {2 i a d (c+d x) \sinh (e+f x)}{f^2} \]

[Out]

1/3*a*(d*x+c)^3/d+2*I*a*d^2*cosh(f*x+e)/f^3+I*a*(d*x+c)^2*cosh(f*x+e)/f-2*I*a*d*(d*x+c)*sinh(f*x+e)/f^2

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3398, 3377, 2718} \begin {gather*} -\frac {2 i a d (c+d x) \sinh (e+f x)}{f^2}+\frac {i a (c+d x)^2 \cosh (e+f x)}{f}+\frac {a (c+d x)^3}{3 d}+\frac {2 i a d^2 \cosh (e+f x)}{f^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2*(a + I*a*Sinh[e + f*x]),x]

[Out]

(a*(c + d*x)^3)/(3*d) + ((2*I)*a*d^2*Cosh[e + f*x])/f^3 + (I*a*(c + d*x)^2*Cosh[e + f*x])/f - ((2*I)*a*d*(c +
d*x)*Sinh[e + f*x])/f^2

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3398

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rubi steps

\begin {align*} \int (c+d x)^2 (a+i a \sinh (e+f x)) \, dx &=\int \left (a (c+d x)^2+i a (c+d x)^2 \sinh (e+f x)\right ) \, dx\\ &=\frac {a (c+d x)^3}{3 d}+(i a) \int (c+d x)^2 \sinh (e+f x) \, dx\\ &=\frac {a (c+d x)^3}{3 d}+\frac {i a (c+d x)^2 \cosh (e+f x)}{f}-\frac {(2 i a d) \int (c+d x) \cosh (e+f x) \, dx}{f}\\ &=\frac {a (c+d x)^3}{3 d}+\frac {i a (c+d x)^2 \cosh (e+f x)}{f}-\frac {2 i a d (c+d x) \sinh (e+f x)}{f^2}+\frac {\left (2 i a d^2\right ) \int \sinh (e+f x) \, dx}{f^2}\\ &=\frac {a (c+d x)^3}{3 d}+\frac {2 i a d^2 \cosh (e+f x)}{f^3}+\frac {i a (c+d x)^2 \cosh (e+f x)}{f}-\frac {2 i a d (c+d x) \sinh (e+f x)}{f^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.25, size = 88, normalized size = 1.19 \begin {gather*} \frac {a \left (f^3 x \left (3 c^2+3 c d x+d^2 x^2\right )+3 i \left (c^2 f^2+2 c d f^2 x+d^2 \left (2+f^2 x^2\right )\right ) \cosh (e+f x)-6 i d f (c+d x) \sinh (e+f x)\right )}{3 f^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2*(a + I*a*Sinh[e + f*x]),x]

[Out]

(a*(f^3*x*(3*c^2 + 3*c*d*x + d^2*x^2) + (3*I)*(c^2*f^2 + 2*c*d*f^2*x + d^2*(2 + f^2*x^2))*Cosh[e + f*x] - (6*I
)*d*f*(c + d*x)*Sinh[e + f*x]))/(3*f^3)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 248 vs. \(2 (69 ) = 138\).
time = 0.37, size = 249, normalized size = 3.36

method result size
risch \(\frac {a \,d^{2} x^{3}}{3}+a d c \,x^{2}+a \,c^{2} x +\frac {a \,c^{3}}{3 d}+\frac {i a \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2} f x -2 c d f +2 d^{2}\right ) {\mathrm e}^{f x +e}}{2 f^{3}}+\frac {i a \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}+2 d^{2} f x +2 c d f +2 d^{2}\right ) {\mathrm e}^{-f x -e}}{2 f^{3}}\) \(148\)
derivativedivides \(\frac {\frac {d^{2} a \left (f x +e \right )^{3}}{3 f^{2}}+\frac {i d^{2} a \left (\left (f x +e \right )^{2} \cosh \left (f x +e \right )-2 \left (f x +e \right ) \sinh \left (f x +e \right )+2 \cosh \left (f x +e \right )\right )}{f^{2}}-\frac {d^{2} e a \left (f x +e \right )^{2}}{f^{2}}-\frac {2 i d^{2} e a \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f^{2}}+\frac {d c a \left (f x +e \right )^{2}}{f}+\frac {2 i d c a \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f}+\frac {d^{2} e^{2} a \left (f x +e \right )}{f^{2}}+\frac {i d^{2} e^{2} a \cosh \left (f x +e \right )}{f^{2}}-\frac {2 d e c a \left (f x +e \right )}{f}-\frac {2 i d e c a \cosh \left (f x +e \right )}{f}+a \,c^{2} \left (f x +e \right )+i c^{2} a \cosh \left (f x +e \right )}{f}\) \(249\)
default \(\frac {\frac {d^{2} a \left (f x +e \right )^{3}}{3 f^{2}}+\frac {i d^{2} a \left (\left (f x +e \right )^{2} \cosh \left (f x +e \right )-2 \left (f x +e \right ) \sinh \left (f x +e \right )+2 \cosh \left (f x +e \right )\right )}{f^{2}}-\frac {d^{2} e a \left (f x +e \right )^{2}}{f^{2}}-\frac {2 i d^{2} e a \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f^{2}}+\frac {d c a \left (f x +e \right )^{2}}{f}+\frac {2 i d c a \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f}+\frac {d^{2} e^{2} a \left (f x +e \right )}{f^{2}}+\frac {i d^{2} e^{2} a \cosh \left (f x +e \right )}{f^{2}}-\frac {2 d e c a \left (f x +e \right )}{f}-\frac {2 i d e c a \cosh \left (f x +e \right )}{f}+a \,c^{2} \left (f x +e \right )+i c^{2} a \cosh \left (f x +e \right )}{f}\) \(249\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2*(a+I*a*sinh(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*(1/3*d^2/f^2*a*(f*x+e)^3+I*d^2/f^2*a*((f*x+e)^2*cosh(f*x+e)-2*(f*x+e)*sinh(f*x+e)+2*cosh(f*x+e))-d^2/f^2*e
*a*(f*x+e)^2-2*I*d^2/f^2*e*a*((f*x+e)*cosh(f*x+e)-sinh(f*x+e))+d/f*c*a*(f*x+e)^2+2*I*d/f*c*a*((f*x+e)*cosh(f*x
+e)-sinh(f*x+e))+d^2/f^2*e^2*a*(f*x+e)+I*d^2/f^2*e^2*a*cosh(f*x+e)-2*d/f*e*c*a*(f*x+e)-2*I*d/f*e*c*a*cosh(f*x+
e)+a*c^2*(f*x+e)+I*c^2*a*cosh(f*x+e))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (69) = 138\).
time = 0.27, size = 149, normalized size = 2.01 \begin {gather*} \frac {1}{3} \, a d^{2} x^{3} + a c d x^{2} + a c^{2} x + i \, a c d {\left (\frac {{\left (f x e^{e} - e^{e}\right )} e^{\left (f x\right )}}{f^{2}} + \frac {{\left (f x + 1\right )} e^{\left (-f x - e\right )}}{f^{2}}\right )} + \frac {1}{2} i \, a d^{2} {\left (\frac {{\left (f^{2} x^{2} e^{e} - 2 \, f x e^{e} + 2 \, e^{e}\right )} e^{\left (f x\right )}}{f^{3}} + \frac {{\left (f^{2} x^{2} + 2 \, f x + 2\right )} e^{\left (-f x - e\right )}}{f^{3}}\right )} + \frac {i \, a c^{2} \cosh \left (f x + e\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+I*a*sinh(f*x+e)),x, algorithm="maxima")

[Out]

1/3*a*d^2*x^3 + a*c*d*x^2 + a*c^2*x + I*a*c*d*((f*x*e^e - e^e)*e^(f*x)/f^2 + (f*x + 1)*e^(-f*x - e)/f^2) + 1/2
*I*a*d^2*((f^2*x^2*e^e - 2*f*x*e^e + 2*e^e)*e^(f*x)/f^3 + (f^2*x^2 + 2*f*x + 2)*e^(-f*x - e)/f^3) + I*a*c^2*co
sh(f*x + e)/f

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (69) = 138\).
time = 0.37, size = 175, normalized size = 2.36 \begin {gather*} \frac {{\left (3 i \, a d^{2} f^{2} x^{2} + 3 i \, a c^{2} f^{2} + 6 i \, a c d f + 6 i \, a d^{2} - 6 \, {\left (-i \, a c d f^{2} - i \, a d^{2} f\right )} x - 3 \, {\left (-i \, a d^{2} f^{2} x^{2} - i \, a c^{2} f^{2} + 2 i \, a c d f - 2 i \, a d^{2} + 2 \, {\left (-i \, a c d f^{2} + i \, a d^{2} f\right )} x\right )} e^{\left (2 \, f x + 2 \, e\right )} + 2 \, {\left (a d^{2} f^{3} x^{3} + 3 \, a c d f^{3} x^{2} + 3 \, a c^{2} f^{3} x\right )} e^{\left (f x + e\right )}\right )} e^{\left (-f x - e\right )}}{6 \, f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+I*a*sinh(f*x+e)),x, algorithm="fricas")

[Out]

1/6*(3*I*a*d^2*f^2*x^2 + 3*I*a*c^2*f^2 + 6*I*a*c*d*f + 6*I*a*d^2 - 6*(-I*a*c*d*f^2 - I*a*d^2*f)*x - 3*(-I*a*d^
2*f^2*x^2 - I*a*c^2*f^2 + 2*I*a*c*d*f - 2*I*a*d^2 + 2*(-I*a*c*d*f^2 + I*a*d^2*f)*x)*e^(2*f*x + 2*e) + 2*(a*d^2
*f^3*x^3 + 3*a*c*d*f^3*x^2 + 3*a*c^2*f^3*x)*e^(f*x + e))*e^(-f*x - e)/f^3

________________________________________________________________________________________

Sympy [A]
time = 0.28, size = 314, normalized size = 4.24 \begin {gather*} a c^{2} x + a c d x^{2} + \frac {a d^{2} x^{3}}{3} + \begin {cases} \frac {\left (\left (2 i a c^{2} f^{5} + 4 i a c d f^{5} x + 4 i a c d f^{4} + 2 i a d^{2} f^{5} x^{2} + 4 i a d^{2} f^{4} x + 4 i a d^{2} f^{3}\right ) e^{- f x} + \left (2 i a c^{2} f^{5} e^{2 e} + 4 i a c d f^{5} x e^{2 e} - 4 i a c d f^{4} e^{2 e} + 2 i a d^{2} f^{5} x^{2} e^{2 e} - 4 i a d^{2} f^{4} x e^{2 e} + 4 i a d^{2} f^{3} e^{2 e}\right ) e^{f x}\right ) e^{- e}}{4 f^{6}} & \text {for}\: f^{6} e^{e} \neq 0 \\\frac {x^{3} \left (i a d^{2} e^{2 e} - i a d^{2}\right ) e^{- e}}{6} + \frac {x^{2} \left (i a c d e^{2 e} - i a c d\right ) e^{- e}}{2} + \frac {x \left (i a c^{2} e^{2 e} - i a c^{2}\right ) e^{- e}}{2} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2*(a+I*a*sinh(f*x+e)),x)

[Out]

a*c**2*x + a*c*d*x**2 + a*d**2*x**3/3 + Piecewise((((2*I*a*c**2*f**5 + 4*I*a*c*d*f**5*x + 4*I*a*c*d*f**4 + 2*I
*a*d**2*f**5*x**2 + 4*I*a*d**2*f**4*x + 4*I*a*d**2*f**3)*exp(-f*x) + (2*I*a*c**2*f**5*exp(2*e) + 4*I*a*c*d*f**
5*x*exp(2*e) - 4*I*a*c*d*f**4*exp(2*e) + 2*I*a*d**2*f**5*x**2*exp(2*e) - 4*I*a*d**2*f**4*x*exp(2*e) + 4*I*a*d*
*2*f**3*exp(2*e))*exp(f*x))*exp(-e)/(4*f**6), Ne(f**6*exp(e), 0)), (x**3*(I*a*d**2*exp(2*e) - I*a*d**2)*exp(-e
)/6 + x**2*(I*a*c*d*exp(2*e) - I*a*c*d)*exp(-e)/2 + x*(I*a*c**2*exp(2*e) - I*a*c**2)*exp(-e)/2, True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 150 vs. \(2 (66) = 132\).
time = 0.44, size = 150, normalized size = 2.03 \begin {gather*} \frac {1}{3} \, a d^{2} x^{3} + a c d x^{2} + a c^{2} x - \frac {{\left (-i \, a d^{2} f^{2} x^{2} - 2 i \, a c d f^{2} x - i \, a c^{2} f^{2} + 2 i \, a d^{2} f x + 2 i \, a c d f - 2 i \, a d^{2}\right )} e^{\left (f x + e\right )}}{2 \, f^{3}} + \frac {{\left (i \, a d^{2} f^{2} x^{2} + 2 i \, a c d f^{2} x + i \, a c^{2} f^{2} + 2 i \, a d^{2} f x + 2 i \, a c d f + 2 i \, a d^{2}\right )} e^{\left (-f x - e\right )}}{2 \, f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*(a+I*a*sinh(f*x+e)),x, algorithm="giac")

[Out]

1/3*a*d^2*x^3 + a*c*d*x^2 + a*c^2*x - 1/2*(-I*a*d^2*f^2*x^2 - 2*I*a*c*d*f^2*x - I*a*c^2*f^2 + 2*I*a*d^2*f*x +
2*I*a*c*d*f - 2*I*a*d^2)*e^(f*x + e)/f^3 + 1/2*(I*a*d^2*f^2*x^2 + 2*I*a*c*d*f^2*x + I*a*c^2*f^2 + 2*I*a*d^2*f*
x + 2*I*a*c*d*f + 2*I*a*d^2)*e^(-f*x - e)/f^3

________________________________________________________________________________________

Mupad [B]
time = 0.25, size = 118, normalized size = 1.59 \begin {gather*} \frac {-\frac {a\,f\,\left (6{}\mathrm {i}\,x\,\mathrm {sinh}\left (e+f\,x\right )\,d^2+6{}\mathrm {i}\,c\,\mathrm {sinh}\left (e+f\,x\right )\,d\right )}{3}+\frac {a\,f^2\,\left (c^2\,\mathrm {cosh}\left (e+f\,x\right )\,3{}\mathrm {i}+d^2\,x^2\,\mathrm {cosh}\left (e+f\,x\right )\,3{}\mathrm {i}+c\,d\,x\,\mathrm {cosh}\left (e+f\,x\right )\,6{}\mathrm {i}\right )}{3}+a\,d^2\,\mathrm {cosh}\left (e+f\,x\right )\,2{}\mathrm {i}}{f^3}+\frac {a\,\left (3\,c^2\,x+3\,c\,d\,x^2+d^2\,x^3\right )}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sinh(e + f*x)*1i)*(c + d*x)^2,x)

[Out]

((a*f^2*(c^2*cosh(e + f*x)*3i + d^2*x^2*cosh(e + f*x)*3i + c*d*x*cosh(e + f*x)*6i))/3 - (a*f*(d^2*x*sinh(e + f
*x)*6i + c*d*sinh(e + f*x)*6i))/3 + a*d^2*cosh(e + f*x)*2i)/f^3 + (a*(3*c^2*x + d^2*x^3 + 3*c*d*x^2))/3

________________________________________________________________________________________